package com.dhl.fin.api.domain;

import com.dhl.fin.api.common.annotation.ExcelTitle;
import com.dhl.fin.api.common.domain.BasicDomain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.Date;

/**
 * @author CuiJianbo
 * @since 2025/3/15
 */

/**
 * 家庭成员
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "t_family")
public class Family extends BasicDomain {

    public Family() {

    }

    public Family(Long id) {
        this.id = id;
    }

    @Column(columnDefinition = "varchar(50) not null")
    private String unicode;

    @Column(columnDefinition = "varchar(20) not null")
    private String memberName;

    @Column(columnDefinition = "varchar(2) not null")
    private String memberAlias;

    @Column(columnDefinition = "varchar(2) not null")
    private String sex;

    @Column(columnDefinition = "varchar(50)")
    private String wxAccountCode;

    @Column(columnDefinition = "varchar(50) not null")
    private String headPicPath;

    @Column(columnDefinition = "date not null")
    private Date birthday;

    @Column(columnDefinition = "bit(1) default 0 not null comment '0:为非户主，1为户主'")
    private Integer owner;

    @Column(columnDefinition = "bit(1) default 0 comment '微信是否已绑定'")
    private Integer bindWx;

    @Transient
    @ExcelTitle(dateFormat = "yyyy年MM月dd日")
    private String birthdayStr;

    @Transient
    private Long age;

    @OneToOne
    @JoinColumn(name = "bank_account_id")
    private BankAccount bankAccount;

    @Transient
    private Boolean canAction;

    @Transient
    private String currentBalanceFormat;

}
